home *** CD-ROM | disk | FTP | other *** search
/ Shareware Games Galore! / Shareware Games Galore!.iso / arcade / gameser5 / hamurabi.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1981-05-28  |  4.6 KB  |  153 lines

  1. 10  KEY OFF
  2. 20  CLS
  3. 30  PRINT TAB(16);"HAMMURABI"
  4. 40  PRINT "Based on the book, BASIC COPUTER GAMES  Microcomputer Edition, by David H Ahl"
  5. 50  PRINT :PRINT :PRINT
  6. 60  PRINT "Try your hand at governing ancient      SUMERIA for a ten-year term of office"
  7. 70  TD=0 'TD=total dead
  8. 80   PP = 0:Z = 0: 'pp = percent of died per year over your term of office, z = year
  9. 90  S = 2800: H = 3000: 's = bushels of grain in store, h = bushels of grain harvested
  10. 100  Y = 3: E = H-S: A = H/Y: 'y = number of bushels of grain harvested per acre, e = bushels of grain the RATS ate, a = the number of acres of land that the city ownes
  11. 110  I = 5: Q = 1 'i = the number of people coming to the city, q = factor
  12. 120  P=95
  13. 130  PRINT :PRINT :PRINT
  14. 140  PRINT "To begin your term of office,enter any"
  15. 150  PRINT :PRINT "number between 0 and 1000";:INPUT R
  16. 160  RANDOMIZE R
  17. 170  D = 0 'd = number of people starved,  begins main program,
  18. 180  CLS:Z=Z+1:IF Z=11 THEN 1090
  19. 190  PRINT "  HAMURABI: I beg to report to you that":PRINT
  20. 200  PRINT "In year";Z;",";D;"people starved,":PRINT
  21. 210  PRINT I;"came to the City,":PRINT
  22. 220  P = P + I
  23. 230  IF Q > 0 THEN 260
  24. 240  P = INT(P/2)
  25. 250  PRINT "a horrible plague struck, killing half  of the population!!!":PRINT
  26. 260  PRINT "The total population is now";P;".":PRINT
  27. 270  PRINT "The City now ownes ";A;"acres of land.":PRINT
  28. 280  PRINT "We harvested ";Y;" bushels per acre.":PRINT
  29. 290  PRINT "The cursed rats ate "E;" bushels.":PRINT
  30. 300  PRINT "We now have ";S;" bushels in storage.":PRINT
  31. 310  C = INT(10*RND(1)):LP = C + 17
  32. 320  PRINT :PRINT :PRINT "Land is trading at";LP;"bushels per acre."
  33. 330  PRINT :PRINT "How many acres do you wish to buy.";
  34. 340  INPUT Q
  35. 350  IF Q<0 THEN 1050
  36. 360  IF LP*Q<=S THEN 390
  37. 370  GOSUB 960
  38. 380  GOTO 330
  39. 390  IF Q=0 THEN 430
  40. 400  A =A+Q
  41. 410  S =S-LP*Q : C=0
  42. 420  GOTO 510
  43. 430  PRINT :PRINT "How many acres do you wish to sell";
  44. 440  INPUT Q
  45. 450  IF Q<0 THEN 1050
  46. 460  IF Q<A THEN 490
  47. 470  GOSUB 1000
  48. 480  GOTO 430
  49. 490  A=A-Q
  50. 500  S=S+LP*Q:C=0
  51. 510  PRINT :PRINT
  52. 520  PRINT "How many bushels do you wish to feed    your people";:INPUT Q
  53. 530  IF Q<0 THEN 1050
  54. 540  IF Q<=S THEN 570 'attempting to   use more grain than is stored
  55. 550  GOSUB 960
  56. 560  GOTO 520
  57. 570  S=S-Q:C=1
  58. 580  PRINT :PRINT
  59. 590  PRINT "How many acres do you wish to plant      with seed";
  60. 600  INPUT G
  61. 610  IF G=0 THEN 740
  62. 620  IF G<0 THEN 1050
  63. 630  IF G <=A THEN 660 'Trying to plant more acres than you own
  64. 640  GOSUB 1000
  65. 650  GOTO 580
  66. 660  IF INT(G/2)<=S THEN 690 'enough grain for planting
  67. 670  GOSUB 960
  68. 680  GOTO 580
  69. 690  IF G<10*P THEN 730
  70. 700  PRINT :PRINT :PRINT "But you only have";P;"people to tend the fields! "
  71. 710  PRINT "Now then,"
  72. 720  GOTO 580
  73. 730  S=S-INT(G/2)
  74. 740  GOSUB 1030
  75. 750  LP=C: H=G*Y:E=0 'bountiful harvest
  76. 760  Y=C
  77. 770  GOSUB 1030
  78. 780  IF INT(C/2)<>C/2 THEN 800
  79. 790  E=INT(S/C) 'RATS ARE RAMPANT !
  80. 800  S=S-E+H
  81. 810  GOSUB 1030
  82. 820  I=INT(C*(20*A+S)/P/100+1)'population growth
  83. 830  C=INT(Q/20) 'adequate food
  84. 840  Q=INT(10*(2*RND(1)-0.3)) '15% chance of PLAGUE11
  85. 850  Q=INT(10*(2*RND(1)-0.3)) '15% chance of PLAGUE !!!
  86. 860  IF P<C THEN 170
  87. 870  D=P-C
  88. 880  IF D>0.45*P THEN 920 'starve enough people for impeachment
  89. 890  PP=((Z-1)*PP+D*100/P)/Z
  90. 900  P=C: TD=TD+D
  91. 910  GOTO 180
  92. 920  CLS :PRINT :PRINT :PRINT "You starved";D;"people in one year!!!"
  93. 930  PRINT :PRINT "Due to this extreme mismanagement,      you have not only"
  94. 940   PRINT "been impeached and thrown out of office but you also have been declared national fink!!!!"
  95. 950  GOTO 1430
  96. 960  PRINT :PRINT "HAMMURABI: Think again. You only have";S
  97. 970  PRINT "bushels of grain. Now then."
  98. 980  RETURN
  99. 990  PRINT :PRINT
  100. 1000  PRINT "HAMMURABI: Think again. You only"
  101. 1010  PRINT "have";A;"acres. Now then."
  102. 1020  RETURN
  103. 1030  C=INT(RND(1)*5)+1 'c=1 to 6
  104. 1040  RETURN
  105. 1050  PRINT :PRINT
  106. 1060  PRINT "HAMMURABI: I cannot do what you wish."
  107. 1070  PRINT "Get yourslf another servant!!!!!!"
  108. 1080  GOTO 1430
  109. 1090  CLS :PRINT :PRINT "In your ten year term of office,"
  110. 1100  PRINT PP;"percent of the population "
  111. 1110  PRINT "starved per year on the average,"
  112. 1120  PRINT "i.e. a total of";TD;"people died!"
  113. 1130  L=A/P
  114. 1140  PRINT "You started with 10 acres per "
  115. 1150  PRINT "person and ended with";L
  116. 1160  PRINT "acres per person.":PRINT
  117. 1170  IF PP>33 THEN 930
  118. 1180  IF L<7 THEN 930
  119. 1190  IF PP>10 THEN 1290
  120. 1200  IF L<9 THEN  1290
  121. 1210  IF PP>3 THEN 1370
  122. 1220  IF L<10 THEN 1370
  123. 1230  PRINT "A SUPER FANTASTIC PERFORMANCE !!!"
  124. 1240  PRINT
  125. 1250  PRINT "Nobody in the entire Kingdom coud have"
  126. 1260  PRINT
  127. 1270  PRINT "done better ! Your truly GREAT !!"
  128. 1280  GOTO 1480
  129. 1290  PRINT "Your heavy handed rule smacks of"
  130. 1300  PRINT
  131. 1310  PRINT "Ivan the Terrible, or Adolf Hitler"
  132. 1320  PRINT
  133. 1330  PRINT "The people (remaining) find you ":PRINT
  134. 1340  PRINT "an unpleasant ruler, and quite ":PRINT
  135. 1350  PRINT "frankly, HATE YOUR GUTS !!!"
  136. 1360  GOTO 1480
  137. 1370  PRINT "Your performance as our Ruler could":PRINT
  138. 1380  PRINT "have been much better, but really":PRINT
  139. 1390  PRINT "wasn't too bad at all.":PRINT
  140. 1400  PRINT "Only "INT(P*0.8*RND(1));"people would":PRINT
  141. 1410  PRINT "like to see you assassinated, but" :PRINT
  142. 1420  PRINT "we all have our own trivial problems."
  143. 1430  PRINT : FOR N=1 TO 10:PRINT CHR(7);
  144. 1440  NEXT N
  145. 1450  SOUND 500,18 :SOUND 1000,18 :SOUND 500,18 
  146. 1480  PRINT :PRINT
  147. 1490  PRINT "Would you like another term of office";
  148. 1500  INPUT CH$
  149. 1510  IF LEFT$(CH$,1)="y" OR LEFT$(CH$,1)="Y" THEN 70
  150. 1530  PRINT "So long for now.":PRINT
  151. 1540  FOR T=1 TO 2500 :NEXT T
  152. 1600  LOAD"masterp",R
  153.